05. Update project.py (part I)
Update project.py (part I)
INSTRUCTOR NOTE:
Important: Facebook has updated their API since this course was released. This affects code that is shown in this video at 0:32 on line 194. Instead of…
url = 'https://graph.facebook.com/v2.2/me?%s' % token
… the code must be…
url = 'https://graph.facebook.com/v2.8/me?access_token=%s&fields=name,id,email' % token
Here is some more information about the change:
An app can make calls to the version of the API that was the latest available when the app was created, as well as any newer, un-deprecated versions launched after the app is created.
Here is the main change from version 2.2 that will impact Full-Stack students:
Fewer default fields for faster performance: To help improve performance on mobile network connections, we've reduced the number of fields that the API returns by default. You should now use the ?fields=field1,field2
syntax to declare all the fields you want the API to return.
They say "we've reduced the number of fields that the API returns by default." This is important because one of the fields that is no longer returned by default is the email
field. You must now explicitly request email to be returned (along with the other fields you want).
The API version 2.2 that was used in this course has been officially deprecated by Facebook as of March 25th, 2017. Requests made to that version will no longer work. Please use the most current version of the Facebook API with your project code.